package com.ganbing518.commons.annotation;

import com.ganbing518.commons.interfaces.EnumInterface;
import com.ganbing518.commons.validator.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * Description:
 *
 * @author gan bing
 * @version V1.0
 * @date 2018-06-25 16:22
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Documented
@Constraint(validatedBy = EnumValidator.class)
public @interface EnumValid {

    Class<? extends EnumInterface> value();

    String message() default "错误的枚举值";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
